package com.example.test1;

public class Demo1 {
    public static void main(String[] args) {
        // 传统代码
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName() + "线程1");
            }
        }).start();
        // lambda表达式
        new Thread(() -> System.out.println(Thread.currentThread().getName() + "线程2")).start();
    }
}
